import router from '../router/index'

import axios from './axios';
const domain='https://tengxiansh.dindong.cn/backstage/';
axios.defaults.baseURL=domain;
axios.interceptors.response.use(function (response) {
  // 重定向到登录页面
  if (response.data.data == 'no_login'){
    window.localStorage.removeItem('user_name');
    router.replace({ path: '/login'})
  }else{
    return response;
  }
})

//用户统计模块
    //统计近七天登录的人数
    export const dataCount = (params) => axios.get('dataCount',{'params':{...params}});
//会员管理
    //获取会员信息
    export const getUserVipDetail = (params) => axios.get('getUserVipDetail',{'params':{...params}});
    //获取会员列表
    export const getUserVipList = (params) => axios.get('getUserVipList',{'params':{...params}});

    //新增会员时候查询手机号
    export const getVipSearchUserInfo = (params) => axios.get('getVipSearchUserInfo',{'params':{...params}});
    //公司名搜索
    export const companyInfoSearch= (params) => axios.get('https://tengxiansh.dindong.cn/api/ucenter/companyInfoSearch',{'params':{...params}});
    //绑定企业
    export const userBindCompany= (params) => axios.post('https://tengxiansh.dindong.cn/api/ucenter/userBindCompany',params);
    //取消绑定的企业
    export const getUserReCompanyInfoDelete= (params) => axios.post('getUserReCompanyInfoDelete',params);

    //绑定企业列表
    export const getUserReCompanyInfoList= (params) => axios.get('getUserReCompanyInfoList',{'params':{...params}});



    //新增会员信息
    export const getUserVipInsert = (params) => axios.post('getUserVipInsert',params);
    //编辑会员信息
    export const getUserVipUpdate = (params) => axios.post('getUserVipUpdate',params);

    //删除会员信息
    export const getUserVipDelete = (params) => axios.post('getUserVipDelete',params);
    //升级会员
    export const getUserVipUpgrade = (params) => axios.post('getUserVipUpgrade',params);

    //获取会员等级&缴费规则接口
    export const getUserVipRule = (params) => axios.get('getUserVipRule',{'params':{...params}});

    //获取用户列表
    export const getUserList = (params) => axios.get('getUserList',{'params':{...params}});
    //查看用户详情
    export const getUserDetail = (params) => axios.get('getUserDetail',{'params':{...params}});

    //获取会员申请列表
    export const getUserVipApplyList = (params) => axios.get('getUserVipApplyList',{'params':{...params}});
    //获取会员申请详细信息
    export const getUserVipApplyDetail = (params) => axios.get('getUserVipApplyDetail',{'params':{...params}});
    //拒绝会员申请
    export const getUserVipApplyRefuse = (params) => axios.post('getUserVipApplyRefuse',params);
    //通过会员申请
    export const getUserVipApplyAgree = (params) => axios.post('getUserVipApplyAgree',params);
    //获取积分规则列表
    export const getIntegralRuleList = (params) => axios.get('getIntegralRuleList',{'params':{...params}});
    //删除积分规则
    export const delIntegralRule = (params) => axios.post('delIntegralRule',params);
    //获取积分规则详情
    export const getIntegralRuleDetail = (params) => axios.get('getIntegralRuleDetail',{'params':{...params}});
    //设置积分规则
    export const setIntegralRule = (params) => axios.post('setIntegralRule',params);
    //获取积分子规则列表
    export const getIntegralChildRuleList = (params) => axios.get('getIntegralChildRuleList',{'params':{...params}});
    //设置积分子规则
    export const setIntegralChildRule = (params) => axios.post('setIntegralChildRule',params);
    //获取积分子规则详情
    export const getIntegralChildRuleDetail = (params) => axios.get('getIntegralChildRuleDetail',{'params':{...params}});
    //删除积分子规则
    export const delIntegralChildRule = (params) => axios.post('delIntegralChildRule',params);
    //积分管理获取用户积分列表
    export const getIntegralList = (params) => axios.get('getIntegralList',{'params':{...params}});
    //获取积分
    export const getIntegralNum = (params) => axios.get('getIntegralNum',{'params':{...params}});
    //新增积分记录
    export const addIntegralRecord = (params) => axios.post('addIntegralRecord',params);
    //删除积分记录
    export const deleteIntegralRecord = (params) => axios.post('deleteIntegralRecord',params);
    //绑定会员
    export const userBindVip = (params) => axios.post('userBindVip',params);
    //导出积分榜详情
    export const getUserIntegralDetailList = (params) => axios.post('getUserIntegralDetailList',params);













    //财务管理
        //获取缴费记录列表
        export const getPaymentList = (params) => axios.get('getPaymentList',{'params':{...params}});
        //新增缴费记录
        export const getPaymentInsert = (params) => axios.post('getPaymentInsert',params);
        //编辑缴费记录
        export const getPaymentUpdate = (params) => axios.post('getPaymentUpdate',params);
        //获取收支列表
        export const accountFlowList = (params) => axios.get('accountFlowList',{'params':{...params}});
        //设置收支管理
        export const setAccountFlow = (params) => axios.post('setAccountFlow',params);
        //获取收支管理信息
        export const accountFlowSet = (params) => axios.get('accountFlowSet',{'params':{...params}});
        //获取捐赠列表
        export const donateList = (params) => axios.get('donateList',{'params':{...params}});
        //新增捐赠记录
        export const addDonateRecord = (params) => axios.post('addDonateRecord',params);
        //删除捐赠记录
        export const deleteDonateRecord = (params) => axios.post('deleteDonateRecord',params);
        //更改捐赠资产状态
        export const donateChangeFixedAssets = (params) => axios.post('donateChangeFixedAssets',params);


        //获取固定资产列表
        export const getAssetsList = (params) => axios.get('getAssetsList',{'params':{...params}});
        //固定资产增删改查
        export const assetsSetting = (params) => axios.post('assetsSetting',params);
        //切换资产状态
        export const changeFixedAssetsStatus = (params) => axios.post('changeFixedAssetsStatus',params);
        //获取积分榜
        export const getIntegralRank = (params) => axios.get('getIntegralRank',{'params':{...params}});
        //查看积分详情
        export const getUserIntegralDetail = (params) => axios.post('getUserIntegralDetail',params);
        //导入Excel文件数据
        export const importExcel = (params) => axios.get('https://tengxiansh.dindong.cn/api/other/importExcel',{'params':{...params}});
        //删除收支
        export const delAccountFlow = (params) => axios.post('delAccountFlow',params);
        //删除缴费
        export const delUserPayment = (params) => axios.post('delUserPayment',params);


        //获取会费返还列表
        export const chamberCommerceFeeReturnList = (params) => axios.get('chamberCommerceFeeReturnList',{'params':{...params}});
        //修改会费返还状态
        export const changeFeeReturnStatus = (params) => axios.post('changeFeeReturnStatus', params);
        //获取费用费用审核列表
        export const getFeeApplicationList = (params) => axios.get('getFeeApplicationList',{'params':{...params}});
        //获取费用审核详情
        export const feeApplicationDetail = (params) => axios.get('feeApplicationDetail',{'params':{...params}});
        //会费审核
        export const feeApplicationReview = (params) => axios.post('feeApplicationReview', params);
        //修改缴费状态
        export const activityUpdateStatus = (params) => axios.post('activityUpdateStatus', params);
        //催缴
        export const callPayment = (params) => axios.post('callPayment', params);





    //商城管理
        //获取商品列表
        export const getShopsList = (params) => axios.get('getShopsList',{'params':{...params}});
        //新增店铺
        export const getShopsInsert = (params) => axios.post('getShopsInsert',params);
        //查看店铺详情
        export const getShopsDetail = (params) => axios.get('getShopsDetail',{'params':{...params}});
        //删除店铺
        export const getShopsDelete = (params) => axios.post('getShopsDelete',params);
        //编辑店铺
        export const getShopsUpdate = (params) => axios.post('getShopsUpdate',params);





    //活动管理
        //获取活动列表
        export const getActivityList = (params) => axios.get('getActivityList', {'params':{...params}});
        //添加活动
        export const getActivityInsert = (params) => axios.post('getActivityInsert',params);
        //删除活动
        export const getActivityDelete = (params) => axios.post('getActivityDelete',params);
        //编辑活动
        export const getActivityUpdate = (params) => axios.post('getActivityUpdate',params);

        //查看活动详情
        export const getActivityDetail = (params) => axios.get('getActivityDetail', {'params':{...params}});
        //查看活动人员
        export const getActivitySignuplist = (params) => axios.get('getActivitySignuplist', {'params':{...params}});
        //更改座位位置
        export const getActivityUpdateSeatNum = (params) => axios.post('getActivityUpdateSeatNum',params);
        //获取签到人的报名详情
        export const getActivitySignupDetail = (params) => axios.get('getActivitySignupDetail', {'params':{...params}});




        // 查看缴费记录
        export const getPaymentDetail = (params) => axios.get('getPaymentDetail',{'params':{...params}});


    //后台登陆
        //登陆功能
        export const signInUser = (params) => axios.post('signInUser',params);

    //任务管理
         //获取任务列表
        export const getTaskInfoList = (params) => axios.get('getTaskInfoList', {'params':{...params}});

        //发布任务
        export const getTaskInfoInsert = (params) => axios.post('getTaskInfoInsert',params);
        //删除任务
        export const getTaskInfoDelete = (params) => axios.post('getTaskInfoDelete',params);
        //获取任务信息
        export const getTaskInfoDetail = (params) => axios.get('getTaskInfoDetail',{'params':{...params}});
        //编辑任务
        export const getTaskInfoUpdate = (params) => axios.post('getTaskInfoUpdate',params);
        //获取任务详情
        export const getTaskInfoUserDetail = (params) => axios.get('getTaskInfoUserDetail',{'params':{...params}});



    //值班表
        //获取值班表
        export const getDakaInfoList = (params) => axios.get('getDakaInfoList', {'params':{...params}});
        //删除值班信息
        export const getDakaInfoDelete = (params) => axios.post('getDakaInfoDelete',params);
        //发布值班信息
        export const getDakaInfoInsert = (params) => axios.post('getDakaInfoInsert',params);

    //值班管理
    export const getUserDakaList = (params) => axios.post('getUserDakaList',params);





//宣传管理
    //企业列表
        //会员企业
        export const getCompanyInfoList = (params) => axios.get('getCompanyInfoList',{'params':{...params}});
        //新增企业
        export const getCompanyInfoInsert = (params) => axios.post('getCompanyInfoInsert',params);
        //获取企业详情
        export const getCompanyInfoDetail = (params) => axios.get('getCompanyInfoDetail',{'params':{...params}});
        //编辑企业详情
        export const getCompanyInfoUpdate = (params) => axios.post('getCompanyInfoUpdate',params);
        //删除企业详情
        export const getCompanyInfoDelete = (params) => axios.post('getCompanyInfoDelete',params);
        //商会简介
        export const getChamberCommerceInfo = () => axios.get('getChamberCommerceInfo');
        //设置商会简介
        export const setChamberCommerceInfo = (params) => axios.post('setChamberCommerceInfo',params);
        //设置杰出人物
        export const setChamberCommerceElite = (params) => axios.post('setChamberCommerceElite',params);
        //删除杰出人物
        export const delChamberCommerceElite = (params) => axios.post('delChamberCommerceElite',params);
        //获取杰出人物信息
        export const chamberCommerceEliteSet = (params) => axios.get('chamberCommerceEliteSet',{'params':{...params}});
        //获取杰出人物列表
        export const chamberCommerceEliteList = (params) => axios.get('chamberCommerceEliteList',{'params':{...params}});
        //是否展示在小程序
        export const changeCompanyShowStatus = (params) => axios.post('changeCompanyShowStatus',params);

    //企业宣传
        //企业宣传列表
        export const getCompanyPublicizeList = (params) => axios.get('getCompanyPublicizeList',{'params':{...params}});
        //获取宣传内容
        export const getPublicizeContent = (params) => axios.get('getPublicizeContent',{'params':{...params}});
        //拒绝，通过企业宣传审核
        export const setCompanyPublicizeStatus = (params) => axios.post('setCompanyPublicizeStatus',params);
        //删除宣传列表
        export const delCompanyPublicize = (params) => axios.post('delCompanyPublicize',params);

    //供求管理
        //供求管理列表
        export const getSupplyDemandList = (params) => axios.get('getSupplyDemandList',{'params':{...params}});
        //供求管理获取内容
        export const getSupplyDemandContent = (params) => axios.get('getSupplyDemandContent',{'params':{...params}});
        //拒绝，通过供求审核
        export const setSupplyDemandStatus = (params) => axios.post('setSupplyDemandStatus',params);
        //删除供求列表
        export const delSupplyDemand = (params) => axios.post('delSupplyDemand',params);













// 商会风采
    //获取风采列表
        export const chamberCommerceStyleList = (params) => axios.get('chamberCommerceStyleList',{'params':{...params}});
        //设置商会风采
        export const setChamberCommerceStyle = (params) => axios.post('setChamberCommerceStyle',params);
        //获取商会风采
        export const chamberCommerceStyleSet = (params) => axios.get('chamberCommerceStyleSet',{'params':{...params}});
        //删除商会风采
        export const delChamberCommerceStyle = (params) => axios.post('delChamberCommerceStyle',params);







//退出登陆&&修改密码
    //获取管理员用户信息
    export const getAdminUserInfo = (params) => axios.get('getAdminUserInfo', {'params':{...params}});
    //用户退出
    export const loginOut = () => axios.post('loginOut');
    //修改密码
    export const changePassword = (params) => axios.post('changePassword', params);

//系统管理模块
    //获取管理员列表
    export const getAdminList = (params) => axios.get('adminList', {'params':{...params}});
    //编辑管理员
    export const adminSet = (params) => axios.get('adminSet', {'params':{...params}});
    //添加管理员
    export const setAdmin = (params) => axios.post('setAdmin', params);
    //删除管理员
    export const delAdmin = (params) => axios.post('delAdmin', params);

    //获取权限列表
    export const getPermissionsList = (params) => axios.get('permissionsList', {'params':{...params}});
    //编辑权限
    export const permissionsSet = (params) => axios.get('permissionsSet', {'params':{...params}});
    //新增权限
    export const addPermissions = (params) => axios.post('setPermissions', params);
    //删除权限
    export const delPermissions = (params) => axios.post('delPermissions', params);

    //获取角色列表
    export const getRoleList = (params) => axios.get('roleList', {'params':{...params}});
    //编辑角色
    export const roleSet = (params) => axios.get('roleSet', {'params':{...params}});
    //添加角色
    export const setRole = (params) => axios.post('setRole', params);
    //删除角色
    export const delRole = (params) => axios.post('delRole', params);

    //轮播图
    export const getBannerList = (params) => axios.get('bannerList', {'params':{...params}});
    //编辑轮播图
    export const bannerSet = (params) => axios.get('bannerSet', {'params':{...params}});
    //新增轮播图
    export const setBanner = (params) => axios.post('setBanner', params);
    //删除角色
    export const delBanner = (params) => axios.post('delBanner', params);

    //栏目管理
    export const getFeaturesMenu = (params) => axios.get('getFeaturesMenu', {'params':{...params}});
    //新增栏目
    export const setFeaturesMenu = (params) => axios.post('setFeaturesMenu', params);
    //删除栏目
    export const delFeaturesMenu = (params) => axios.post('delFeaturesMenu', params);

    //获取会员级别管理列表
    export const getVipRuleList = (params) => axios.get('getVipRuleList', {'params':{...params}});
    //获取会员级别信息详情
    export const getVipRuleDetail = (params) => axios.get('getVipRuleDetail', {'params':{...params}});
    //设置会员级别
    export const setVipRule = (params) => axios.post('setVipRule', params);
    //设置会员级别
    export const delVipRule = (params) => axios.post('delVipRule', params);

    //获取缴费方式列表
    export const getPayRuleList = (params) => axios.get('getPayRuleList', {'params':{...params}});
    //设置缴费方式
    export const setPayRule = (params) => axios.post('setPayRule', params);
    //获取缴费方式详情
    export const getPayRuleDetail = (params) => axios.get('getPayRuleDetail', {'params':{...params}});
    //删除缴费方式
    export const delPayRule = (params) => axios.post('delPayRule', params);

    //获取小程序线下支付提示页面内容
    export const getOfflinePayContent = (params) => axios.get('getOfflinePayContent', {'params':{...params}});
    //获取小程序线下支付提示页面内容
    export const setOfflinePayContent = (params) => axios.post('setOfflinePayContent', params);
